package net.user.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import net.user.db.member.MemberBean;
import net.user.db.member.MemberDAO;

public class MemberModifyAction_1 implements Action{
	public ActionForward execute(HttpServletRequest request, HttpServletResponse response)
	throws Exception{
		
		System.out.println("net.user.action.MemberModifyAction_1.execute()");
		
		ActionForward forward=new ActionForward();
		HttpSession sesseion=request.getSession(true);
		String id=(String)sesseion.getAttribute("id");
		
		if(id==null){
			forward.setRedirect(true);
			forward.setPath("./login.us");
			return forward;
		}
		
		MemberDAO memberdao=new MemberDAO();
		MemberBean dto=memberdao.getMember(id);
		
		request.setAttribute("member", dto);
		
		forward.setRedirect(false);
		forward.setPath("./member/info.jsp"); 			
		return forward;
	}
}
